-
-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop request.timer
attribute.
#1249
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice bit of uncoupling. Left a sanity check question but this looks good!
Before we merge this, do we think we've got the right name?
Anything else? Which of those is preferable? |
Yup, I think I prefer this one better. (True that |
Minor bit of refactoring. We don't really want a
request.timer
attribute in our public API, exposing an internalElapsedTimer
instance.Instead support a
Response(..., stream=..., get_elapsed_time=...)
parameter, which allows passing in a callable that is used to setresponse.elapsed
when the response is closed. We don't particularly expect our users to need to use this, but it's a little neater and more tightly scoped than having an accessible timer on the request instance.Also allows us to use a backend-native timer, appropriate to whichever context we're running in.